using System;
using SheLife.Domain.Common;

namespace SheLife.Domain.Entities
{
    /// <summary>
    /// 系统任务实体类
    /// </summary>
    public class SystemTask : BaseEntity
    {
        /// <summary>
        /// 任务名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 任务编码
        /// </summary>
        public string Code { get; set; }

        /// <summary>
        /// 任务类型
        /// </summary>
        public string Type { get; set; }

        /// <summary>
        /// 任务分组
        /// </summary>
        public string Group { get; set; }

        /// <summary>
        /// 任务描述
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// 执行表达式（Cron表达式）
        /// </summary>
        public string CronExpression { get; set; }

        /// <summary>
        /// 任务参数
        /// </summary>
        public string Parameters { get; set; }

        /// <summary>
        /// 任务状态
        /// </summary>
        public string Status { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        public bool IsEnabled { get; set; }

        /// <summary>
        /// 是否并发执行
        /// </summary>
        public bool IsConcurrent { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public DateTime? StartTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public DateTime? EndTime { get; set; }

        /// <summary>
        /// 最后执行时间
        /// </summary>
        public DateTime? LastExecutionTime { get; set; }

        /// <summary>
        /// 下次执行时间
        /// </summary>
        public DateTime? NextExecutionTime { get; set; }

        /// <summary>
        /// 执行次数
        /// </summary>
        public int ExecutionCount { get; set; }

        /// <summary>
        /// 成功次数
        /// </summary>
        public int SuccessCount { get; set; }

        /// <summary>
        /// 失败次数
        /// </summary>
        public int FailureCount { get; set; }

        /// <summary>
        /// 超时时间(秒)
        /// </summary>
        public int Timeout { get; set; }

        /// <summary>
        /// 重试次数
        /// </summary>
        public int RetryCount { get; set; }

        /// <summary>
        /// 重试间隔(秒)
        /// </summary>
        public int RetryInterval { get; set; }

        /// <summary>
        /// 创建人ID
        /// </summary>
        public Guid CreatedBy { get; set; }

        /// <summary>
        /// 更新人ID
        /// </summary>
        public Guid? UpdatedBy { get; set; }

        // 导航属性
        public ICollection<SystemTaskLog> TaskLogs { get; set; }
    }
}